import config from "@/config";
import http from "@/utils/request";
export default {
	page: {
		url: `${config.API_URL}/ai/gateway/channel/page`,
		name: "分页列表",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/ai/gateway/channel/update`,
		name: "更新",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	remove: {
		url: `${config.API_URL}/ai/gateway/channel/remove`,
		name: "删除",
		post: async function (data) {
			return await http.post(this.url + "/" + data);
		},
	},
	updateDisable: {
		url: `${config.API_URL}/ai/gateway/channel/status/disable`,
		name: "更新禁用状态",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	updateAutomatically: {
		url: `${config.API_URL}/ai/gateway/channel/status/automatically`,
		name: "更新监控状态",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	create: {
		url: `${config.API_URL}/ai/gateway/channel/create`,
		name: "创建",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	platforms: {
		url: `${config.API_URL}/ai/gateway/channel/platforms`,
		name: "获取平台支持的大模型渠道",
		get: async function () {
			return await http.get(this.url);
		},
	},
	test: {
		url: `${config.API_URL}/ai/gateway/channel/test`,
		name: "测试渠道接口 -1 代表不通  其他的代表响应时长",
		get: async function (data) {
			return await http.get(this.url + "/" + data); // 返回测试时长
		},
	},
	updateOrder: {
		url: `${config.API_URL}/ai/gateway/channel/update/order`,
		name: "更新优先级",
		get: async function (data, order) {
			return await http.get(this.url + "/" + data + "?order=" + order);
		},
	},
};
